package com.show.mytest;

// 通过实现Runnable创建MyRunnable类
public class MyRunnable implements Runnable {
    @Override
    public void run() {
        // 设置线程名称
        Thread.currentThread().setName("C罗");
        // 创建线程循环
        for (int i = 0; i < 100; i++) {
            System.out.println(Thread.currentThread().getName() + "正在第 " + (i + 1) + " 次射门");
        }
    }
}
